package com.fuhao.activeMQ.listener;

import com.fuhao.model.Mail;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import java.io.IOException;

public class TopicListener1 implements MessageListener {

	@Override
	public void onMessage(Message message) {
		ObjectMessage objectMessage = (ObjectMessage) message;
		try {
			Mail mail = (Mail) objectMessage.getObject();
			System.out.println("queue:消费者1收到的信息：" +mail);

		} catch (JMSException e) {
			e.printStackTrace();
		}
	}
}
